<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">
        <input v-model='mytext' @input='handleClick()'/>
        <ul>
            <li v-for="data in dataliFun()">
                {{data}}
            </li>
        </ul>
    </div>
    <script src="./vue2.js"></script>
    <script>
        new Vue({
            el:'#box',
            data:{
                mytext:'',
                datalist:['aaa','aba','baa','css','ass','bss']
            },
            methods:{
                handleClick(){
                    console.log(this.mytext);
                },
                dataliFun(){
                    return this.datalist.filter(item=>item.includes(this.mytext))
                }
            }
        })
    </script>
</body>
</html>